package com.seeyou.lake.net

import com.seeyou.lake.bean.ArticleBean
import com.seeyou.lake.bean.ModelBean
import com.seeyou.lake.bean.UserBean
import okhttp3.MultipartBody
import okhttp3.RequestBody
import okhttp3.ResponseBody
import retrofit2.http.*

/**
 * @des Api
 * @date 2021/9/24
 * @author fade
 */
interface IServer {


    @FormUrlEncoded
    @POST("poetry/user/signInGoogle")
    suspend fun loginByGoogle(@FieldMap map: HashMap<String, Any>): BaseResult<UserBean>


    @GET("poetry/model/getModelList")
    suspend fun getModelList(): BaseResult<List<ModelBean>>


    @Multipart
    @POST("/poetry/file/addArticle")
    suspend fun addArticle(
        @Query("uid") uid: String,
        @Query("content") content: String,
        @Query("title") title: String,
        @Query("type") type: Int,
        @Query("secret") secret: Int,
        @Part file: MultipartBody.Part
    ): BaseResult<String>


    @GET("poetry/article/getArticleList")
    suspend fun getArticleList(
        @Query("userId") userId: String,
        @Query("secret") secret: Int
    ): BaseResult<List<ArticleBean>>


    @FormUrlEncoded
    @POST("poetry/article/deleteArticle")
    suspend fun deleteArticle(
        @Field("pid") pid: String
    ): BaseResult<Any>

    @FormUrlEncoded
    @POST("poetry/user/secretStatus")
    suspend fun getSecretStatus(
        @Field("uid") userId: String
    ): BaseResult<Int>

    @FormUrlEncoded
    @POST("poetry/user/setSecret")
    suspend fun setSecret(
        @Field("uid") userId: String,
        @Field("secret") secret: String
    ): BaseResult<UserBean>



}
